home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / minix / update~4.z / update~4 / lib_stdio_notused_vsscanf.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-06  |  582 b   |  33 lines

  1. /*                v s s c a n f
  2.  *
  3.  * This function provides the same functionality as sscanf except
  4.  * that it uses varargs.h.
  5.  *
  6.  * Patchlevel 1.0
  7.  *
  8.  * Edit History:
  9.  */
  10.  
  11. #include "stdiolib.h"
  12.  
  13. /*LINTLIBRARY*/
  14.  
  15. int vsscanf(buf, fmt, args)
  16.  
  17. char *buf;                /* output buffer */
  18. char *fmt;                /* format */
  19. va_list args;                /* argument list */
  20.  
  21. {
  22.   FILE f;                /* temporary file */
  23.   int strlen();                /* get length of string */
  24.  
  25.   f._flag   = _IOREAD | _IOSTRING;
  26.   f._base   = (unsigned char *) buf;
  27.   f._bufsiz = strlen(buf);
  28.  
  29.   INITREADBUFFER(&f, f._bufsiz);
  30.  
  31.   return vfscanf(&f, fmt, args);
  32. }
  33.